package com.example.springbootdemo.Service.Impl;
import com.example.springbootdemo.Mapper.UserMapper;
import com.example.springbootdemo.Model.User;
import com.example.springbootdemo.Service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Cacheable(value = "UserCache", key = "'user.getAllUsers'")
    public List<User> getAllUsers() {
        return this.userMapper.getAllUsers();
    }
}
